import service from "@/service";

//一梁一码【分页列表】
export function getTraceabilityList(data) {
  let { page, pageSize } = data;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/lcTaskManager/getList?page=${page}&pageSize=${pageSize}`,
    method: "POST",
    data,
  });
}
//一梁一码【出梁】
export function traceabilitySaveJq(data) {
  let { id, ylEndTime } = data;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/lcTaskManager/saveJqTime?id=${id}&ylEndTime=${ylEndTime}`,
    method: "POST",
  });
}

//一梁一码【按钮权限】
export function traceabilityButtonAuth() {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/lcTaskManager/buttonAuth`,
    method: "POST",
  });
}

//一梁一码【单条下发任务单】
export function submitOrder(params) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/lcTaskManager/submitOrder`,
    method: "GET",
    params,
  });
}

//一梁一码【批量下发任务单】
export function submitOrderAll(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/lcTaskManager/submitOrderAll`,
    method: "POST",
    data,
  });
}

//一梁一码【推送列表】
export function mesgList(params) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/lcTaskManager/mesgList`,
    method: "GET",
    params,
  });
}

//一梁一码【流程配置】
export function getNodeList(data) {
  let { page, pageSize } = data;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/lcTaskNode/getList?page=${page}&pageSize=${pageSize}`,
    method: "POST",
    data,
  });
}

//一梁一码【流程配置 查询所有人员】
export function getAllUserQXData(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/lcTaskNode/getAllUserQXData`,
    method: "POST",
    data,
  });
}

//一梁一码【流程配置 查询已选人员】
export function getChooseUserData(data) {
  let { id } = data;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/lcTaskNode/getChooseUserData?id=${id}`,
    method: "POST",
  });
}

//一梁一码【流程配置 查询已选人员】
export function chooseUserUpdateData(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/lcTaskNode/updateData`,
    method: "POST",
    data,
  });
}
//一梁一码【查看详情】
export function getTraceabilityDetail(data) {
  let { id } = data;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/lcTaskManager/getDetail?id=${id}`,
    method: "POST",
    data,
  });
}

//一梁一码【查询头部流程】
export function getHeadFlowList(params) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/lcTaskManager/getHeadFlowList`,
    method: "GET",
    params,
  });
}

//一梁一码【查询页面流程】
export function getBodyFlowList(params) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/lcTaskManager/getBodyFlowList`,
    method: "GET",
    params,
  });
}

//一梁一码 现场接单【操作页数据接口】
export function getXianChangJieDanOPInfo(params) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/lcTaskManager/getXianChangJieDanOPInfo`,
    method: "GET",
    params,
  });
}

//一梁一码【提交审批】
export function approveOrder(data) {
  let { controlId } = data;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/lcTaskManager/approveOrder?controlId=${controlId}`,
    method: "POST",
    data,
  });
}
//一梁一码【合摸提交】
export function approveOrderHM(data) {
  let { controlId } = data;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/lcTaskManager/approveOrderHM?controlId=${controlId}`,
    method: "POST",
    data,
  });
}

//一梁一码 现场接单【详情页数据接口】
export function getShowInfoByFlag(params) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/lcTaskManager/getXianChangJieDanViewInfo`,
    method: "GET",
    params,
  });
}

//一梁一码 钢筋加工【详情页数据接口】
export function getGJJGInfo(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/rebar-process/getByParams`,
    method: "POST",
    data,
  });
}

//一梁一码 要料申请【详情页数据接口】
export function getYLSQInfo(params) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/lcTaskManager/getYaoLiaoShenQingViewInfo`,
    method: "GET",
    params,
  });
}
//一梁一码 拌和(统计、列表)
export function queryDataByComponentParts(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/sn-mp-data/queryDataByComponentParts`,
    method: "POST",
    data,
  });
}

//一梁一码 模版安装
export function queryDataByComparts(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/quality-template-data/queryDataByComparts`,
    method: "POST",
    data,
  });
}

//一梁一码 鱼雷罐
export function queryStaticsByComparts(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/quality-torpedo-ladle/queryStaticsByComparts`,
    method: "POST",
    data,
  });
}
//一梁一码 鱼雷罐 (列表)
export function getYLGDetail(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/quality-torpedo-ladle/queryListByComparts`,
    method: "POST",
    data,
  });
}

//一梁一码  布料统计
export function clothDataStatics(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/quality-cloth-data/clothDataStatics`,
    method: "POST",
    data,
  });
}

//一梁一码  振捣统计
export function cboostDataStatics(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/quality-boost-island/cboostDataStatics`,
    method: "POST",
    data,
  });
}
//一梁一码 蒸养
export function zyDataByComparts(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/quality-ys-data-detail/queryDataByComparts`,
    method: "POST",
    data,
  });
}

//一梁一码 喷淋
export function plDataByComparts(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/quality-ys-data/queryDataByComparts`,
    method: "POST",
    data,
  });
}

//一梁一码 张拉数据(统计、列表)
export function queryZlDataByComponentParts(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/sn-zl/queryDataByComponentParts`,
    method: "POST",
    data,
  });
}

//一梁一码 压浆数据(统计、列表)
export function queryYjDataByComponentParts(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/sn-yj/queryDataByComponentParts`,
    method: "POST",
    data,
  });
}

//一梁一码 移梁下拉框(统计、列表)
export function getYLSelect(params) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/lcTaskManager/getYiLiangInfo`,
    method: "GET",
    params,
  });
}

//wbs管理-树形数据
export function getScheduleWbs(orgCode) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/scheduleWbs/getTreeData?orgCode=${orgCode}`,
    method: "POST",
  });
}
//wbs管理-查询工程下拉框
export function getWorksSelect(orgCode) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/scheduleWbs/getWorksSelect?orgCode=${orgCode}`,
    method: "POST",
  });
}
//wbs管理-新增、编辑
export function getWbsSaveOrUpdate(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/scheduleWbs/saveOrUpdateData`,
    method: "POST",
    headers: {
      "Content-Type": "multipart/form-data",
    },
    data,
  });
}
//wbs管理-删除
export function getWbsDelete(id) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/scheduleWbs/deleteData?id=${id}`,
    method: "POST",
  });
}
//wbs管理-详情
export function getWbsDetail(id) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/scheduleWbs/getDetail?id=${id}`,
    method: "POST",
  });
}
//wbs管理-列表
export function getWbsList(query) {
  let { page, pageSize } = query;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/scheduleWbs/getListData?page=${page}&pageSize=${pageSize}`,
    method: "POST",
    data: query,
  });
}
//wbs管理-批量导入
export function batchImport(data, orgCode) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/scheduleWbs/importExcel?orgCode=${orgCode}`,
    method: "POST",
    headers: {
      "Content-Type": "multipart/form-data",
    },
    data,
  });
}
//wbs管理-下载模板
export function downloadWbsTemplate() {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/scheduleWbs/downloadTemplate`,
    method: "GET",
    apiType: "file",
    responseType: "arraybuffer",
  });
}
//wbs管理-批量导出
export function exportWbsExcel(orgCode) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/scheduleWbs/exportData?orgCode=${orgCode}`,
    method: "POST",
    apiType: "file",
    responseType: "arraybuffer",
  });
}
//wbs管理-查询操作权限
export function getWbsOperateQx(orgCode) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/scheduleWbs/getOperateQx?orgCode=${orgCode}`,
    method: "POST",
  });
}

//工序报验-【单位工程下拉框】
export function getUnitWorksSelect(params) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/scheduleWbsProcedure/getUnitWorksSelect`,
    method: "GET",
    params,
  });
}
//工序报验-查询【完成数量和总数量】
export function getQuantityStatistics(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/scheduleWbsProcedure/getStatisticsNumber`,
    method: "POST",
    data,
  });
}
//工序报验-查询【今日报验审批数量】
export function getTodayNumebr(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/scheduleWbsProcedure/getStatisticsToday`,
    method: "POST",
    data,
  });
}
//工序报验-查询【首页列表】
export function getUnitWordList(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/scheduleWbsProcedure/getUnitWordList`,
    method: "POST",
    data,
  });
}

//工序报验-查询【单位工程信息】
export function getUnitWordDetail(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/scheduleWbsProcedure/getUnitWordDetail`,
    method: "POST",
    data,
  });
}

//工序报验-查询【工程信息树】
export function getGCXXTreeData(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/scheduleWbsProcedure/getGCXXTreeData`,
    method: "POST",
    data,
  });
}
//工序报验-查询【工程列表】
export function getGCXXList(data) {
  let { page, pageSize } = data;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/scheduleWbsProcedure/getGCXXList?page=${page}&pageSize=${pageSize}`,
    method: "POST",
    data,
  });
}
//工序报验-查询【报验审批权限】
export function getButtonAuth(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/scheduleWbsProcedure/getButtonAuth`,
    method: "POST",
    data,
  });
}

//工序报验-查询【开始报验列表】
export function getGXBYList(data) {
  let { page, pageSize } = data;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/scheduleWbsProcedure/getGXBYList?page=${page}&pageSize=${pageSize}`,
    method: "POST",
    data,
  });
}
//工序报验-查询【报验页面初始化】
export function getInspectionInit(id, data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/scheduleWbsProcedure/getInspectionInit?id=${id}`,
    method: "POST",
    data,
  });
}
//工序报验-报验页面-查询工序下拉框
export function getGXSelectData(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/scheduleWbsProcedure/getGXSelectData`,
    method: "POST",
    data,
  });
}

//工序报验-附件上传
export function uploadFileByType(data, form) {
  return service({
    method: "POST",
    baseUrl: "gateWaybaseUrl",
    url: `/beam/configFile/uploadFileByType?form=${form}`,
    data,
  });
}
//工序报验-报验页面-提交或暂存
export function submitProcedure(data) {
  return service({
    method: "POST",
    baseUrl: "gateWaybaseUrl",
    url: `/beam/scheduleWbsProcedure/submitProcedure`,
    data,
  });
}
//工序报验-查询【报验记录详情】
export function bYJLDetails(data) {
  let { id } = data;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/scheduleWbsProcedure/getInspectionDetail?id=${id}`,
    method: "POST",
  });
}

//工序报验-查询【报验记录列表】
export function getBYJLList(data) {
  let { page, pageSize } = data;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/scheduleWbsProcedure/getBYJLList?page=${page}&pageSize=${pageSize}`,
    method: "POST",
    data,
  });
}

//工序报验-查询【报验记录子列表】
export function getBYJLChildList(data) {
  let { id } = data;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/scheduleWbsProcedure/getBYJLChildList?id=${id}`,
    method: "POST",
  });
}
//工序报验-【报验记录-提交】
export function bYJLSubmit(data) {
  let { id } = data;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/scheduleWbsProcedure/commitInspectionData?id=${id}`,
    method: "POST",
  });
}
//工序报验-【报验记录-撤回】
export function bYJLRevocation(data) {
  let { id } = data;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/scheduleWbsProcedure/backInspectionData?id=${id}`,
    method: "POST",
  });
}

//工序报验-【报验记录删除】
export function bYJLDelete(data) {
  let { id } = data;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/scheduleWbsProcedure/deleteInspectionData?id=${id}`,
    method: "POST",
  });
}
//工序报验-查询【审批记录列表】
export function getSPJLList(data) {
  let { page, pageSize } = data;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/scheduleWbsProcedure/getSPJLList?page=${page}&pageSize=${pageSize}`,
    method: "POST",
    data,
  });
}
//工序报验-查询【审批记录子列表】
export function getSPJLChildList(data) {
  let { id } = data;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/scheduleWbsProcedure/getBYJLChildList?id=${id}`,
    method: "POST",
  });
}
//工序报验-查询【工程列表详情】
export function getGCDetails(data) {
  let { id } = data;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/scheduleWbsProcedure/getInspectionDetailByWbsId?id=${id}`,
    method: "POST",
  });
}
//工序报验-查询【审批表单】
export function getApproveFormData(data) {
  let { id } = data;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/scheduleWbsProcedure/approveFormData?id=${id}`,
    method: "POST",
  });
}
//工序报验-审批
export function approveData(data) {
  return service({
    method: "POST",
    baseUrl: "gateWaybaseUrl",
    url: `/beam/scheduleWbsProcedure/approveData`,
    data,
  });
}
//工序报验-驳回列表
export function getGXRejectList(data) {
  let { page, pageSize } = data;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/scheduleWbsProcedure/getBHList?page=${page}&pageSize=${pageSize}`,
    method: "POST",
    data,
  });
}
//查询自检人
export function getSelfTestPeople(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/scheduleWbsProcedure/getPersonList`,
    method: "POST",
    data,
  });
}

//查询同养试块试验
export function getTestComponentParts(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beamTrial/trial-test-data/api/getDataByComponentParts`,
    method: "POST",
    data,
  });
}

//责任人信息变更
export function updateFlowOwner(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/lcTaskManager/updateFlowOwner`,
    method: "POST",
    data,
  });
}

//一梁一码【流程配置 查询已选责任人】
export function getFlowOwner(data) {
  let { id } = data;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/lcTaskNode/getChooseUserDataConfig?id=${id}`,
    method: "POST",
  });
}

//查询指派记录
export function getAssignRecord(params) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/lcTaskManager/assignRecord`,
    method: "GET",
    params,
  });
}
